<%--
    Document   : Register
    Created on : Sep 29, 2012, 4:34:35 PM
    Author     : MinhThang
--%>

<%@page contentType="text/html" pageEncoding="UTF-8" errorPage="error.jsp" %>
<%@page import="org.apt.Bean.MemberEnties"%>
<%@page import="com.myapp.DAO.MemberDao"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="description" content="website description" />
        <meta name="keywords" content="website keywords, website keywords" />
        <meta http-equiv="content-type" content="text/html; charset=windows-1252" />
        <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine&amp;v1#" />
        <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz" />
        <link rel="stylesheet" type="text/css" href="style/style.css" />
        <style type="text/css">
            * {font-family:Arial, Helvetica, sans-serif;
               font-size:10pt;}
            </style>

            <script type="text/javascript">
                function checkinputpass(){
                    var password = document.fchangepasword.txtOldPassword.value;
                    var newPassword = document.fchangepasword.txtNewPassword.value;
                    var reNewPassword = document.fchangepasword.txtRePassword.value;

                    if(password==null || password =="")
                    {
                        alert('Old password is require');
                        document.fchangepasword.txtOldPassword.focus();
                        return false;
                    }
                  
                    if(newPassword =='')
                    {
                        alert( 'New password is require');
                        document.fchangepasword.txtNewPassword.focus();
                        return false;
                    }

                    if(newPassword.length < 6 ||newPassword.length > 50 )
                    {
                        alert('New assword must between 6 to 50 character');
                        document.fchangepasword.txtNewPassword.select();
                        return false;
                    }

                    if(reNewPassword =='')
                    {
                        alert('Repeat new password is require');
                        document.fchangepasword.txtRePassword.focus();
                        return false;
                    }

                    if(reNewPassword != newPassword)
                    {
                        alert('Repeat password must be same password');
                        document.fchangepasword.txtRePassword.select();
                        return false;
                    }
                   
                }
            </script>
            <title>Change Password Member</title>
        </head>
        <body>
            <div>
                <div><%@include file="UserTemplate/Banner.jsp" %></div>
                <div id="site_content">
                    <%
                                String username = "";
                                if (request.getParameter("user") != null) {
                                    username = request.getParameter("user");
                                } else if (session.getAttribute("UserID") != null) {
                                    username = (String) session.getAttribute("UserID");
                                }
                    %>
                    <div id="content">
                        <form  action="changePasswordMember?username=<%=username%>" onsubmit="return checkinputpass();"  method="post" name="fchangepasword"  id="fchangepasword">
                            <table  class="tableRegiter" style="width: 99.5%">
                            <tbody>
                                <tr >
                                    <td colspan="2"c class="headerTable"><h3>Change password</h3></td>
                                </tr>
                                <tr>
                                    <td class="leftForm">Old Password : </td>
                                    <td class="centerForm"><input type="password" id="textinput" name="txtOldPassword" /> </td>
                                </tr>
                                <tr>
                                    <td class="leftForm">New Password : </td>
                                    <td class="centerForm"><input type="password"id="textinput" name="txtNewPassword" /></td>
                                </tr>

                                <tr>
                                    <td class="leftForm">Repeat New Password : </td>
                                    <td class="centerForm"><input type="password"id="textinput"name="txtRePassword" /></td>
                                </tr>
                                <tr>
                                    <td class="centerForm" colspan="2"><center>
                                            <input type="submit" id="pagestatus" value="Change" class="buttom" />
                                            <a  id="pagestatus" class="buttom" href="index.jsp">Cancel</a>
                                            <a  id="pagestatus" class="buttom" href="Member.jsp">Back</a></center>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </form>
                </div>
                <div><%@include file="UserTemplate/MenuRight.jsp" %></div>
            </div>
            <div></div>
            <div><%@include file="UserTemplate/Footer.jsp" %></div>
        </div>
    </body>
</html>//lon